use Test::More tests => 8;

use lib "../lib/cpp", "../lib/ioc", "../lib/toolkit", '../lib/message';

use TinyMessage;
use CHeaderParser;
use Signature;

CHeaderParser::parse(\*DATA, {
	bind_singleton => sub {
		my ($context, $class, $impl, $method) = @_;
		
		is(signature($class), 'LogService');
		is(signature($impl), 'ConsoleLogService');
		is($method, 'getLogSeriviceSingleton');
		is($context->classContext()->name(), 'ConsoleLogModule');
	},
	
	bind_direct => sub {
		my ($context, $class, $impl, $method) = @_;
		
		is(signature($class), 'LogService');
		is(signature($impl), 'ConsoleLogService');
		is($method, 'getLogSeriviceDirect');
		is($context->classContext()->name(), 'ConsoleLogModule');
	},
		
	bind_provider => sub {
		my ($context, $class, $impl, $method) = @_;
		
		is(signature($class), 'LogService');
		is(signature($impl), 'ConsoleLogServiceProvider');
		is($method, 'getLogSeriviceCustom');
		is($context->classContext()->name(), 'ConsoleLogModule');
	} 
});

__DATA__

/*
 * ConsoleLogModule.h
 *
 *  Created on: 21.11.2011
 *      Author: caiiiycuk
 */

#ifndef CONSOLELOGMODULE_H_
#define CONSOLELOGMODULE_H_

#include "../services/LogService.h"
#include "../services/ConsoleLogService.h"
#include "../../ioc/headers/ioc.h"

#include "ConsoleLogServiceProvider.h"

class ConsoleLogModule {
protected:
public:
	BIND<LogService, SINGLETON<ConsoleLogService> > getLogSeriviceSingleton();
	BIND<LogService, DIRECT<ConsoleLogService> > getLogSeriviceDirect();
	BIND<LogService, ConsoleLogServiceProvider > getLogSeriviceCustom();

};



#endif /* CONSOLELOGMODULE_H_ */